package com.infore.airsupervise.ui.widget;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.infore.airsupervise.R;

/**
 * Empty View
 * <p>
 * 作者: dingxinlin
 * 创建日期: 2017/4/17 13:17
 */

public class EmptyView extends LinearLayout {

    private Context context;

    private ImageView imageView;

    public EmptyView(Context context) {
        this(context, null);
    }

    public EmptyView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public EmptyView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context = context;

        View emptyView = LayoutInflater.from(context).inflate(R.layout.common_empty_view, this);
        imageView = (ImageView) emptyView.findViewById(R.id.image_view);
    }

    /**
     * 设置
     * @param imgRes
     * @param text
     */
    public void setShowInfo(int imgRes, String text) {
        imageView.setImageResource(imgRes);
    }

}
